import request from '@/utils/request'
/**
 * 获取部门
 * @returns
 */
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}
/**
 *
 * 添加部门
 * @returns
 */
export function addDepartments(depts) {
  return request({
    url: '/company/department',
    method: 'POST',
    params: depts
  })
}
/**
 * 删除部门
 */
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
/**
 * 获取某个部门的详情
 */
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}
/**
 * 保存编辑的数据
 */
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
